<?php
/* @var $this NaddressController */
/* @var $model Naddress */

$this->breadcrumbs=array(
	'[地址]管理'=>array('admin'),
	'[地址]列表',
);
//设置页面标题
$this->pageTitle=Yii::app()->name.' - [地址]列表';
$this->contentTitle='[地址]列表';
?>
<!-- 查询表单 -->
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
<!-- 查询表单 -->

<!-- 数据表格 -->
<table cellspacing="1" class="mylist2">
	<thead>
		<tr class="mylist_title">
			<td width="3%"><input type="checkbox" class="checkbox" onclick="InverSelect();" /></td>
			<td><?php echo CHtml::encode($model->getAttributeLabel('id')); ?></td>
			<td><?php echo CHtml::encode($model->getAttributeLabel('phone')); ?></td>
			<td><?php echo CHtml::encode($model->getAttributeLabel('code')); ?></td>
			<td><?php echo CHtml::encode($model->getAttributeLabel('province')); ?></td>
			<td><?php echo CHtml::encode($model->getAttributeLabel('city')); ?></td>
			<td><?php echo CHtml::encode($model->getAttributeLabel('area')); ?></td>
			<td><?php echo CHtml::encode($model->getAttributeLabel('address')); ?></td>
			<td><?php echo CHtml::encode($model->getAttributeLabel('is_used')); ?></td>
			<td width="160" align="center">操 作</td>
		</tr>
	</thead>
	<tbody>
		<?php foreach ($data->getData() as $key => $value) {?>
		<tr class="datalist">
			<td align="center"><input name="id[]" type="checkbox" value="<?php echo CHtml::encode($value->id); ?>" class="checkbox" /></td>
			<td><?php echo CHtml::encode($value->id);?></td>
			<td><?php echo CHtml::encode($value->phone);?></td>
			<td><?php echo CHtml::encode($value->code);?></td>
			<td><?php echo CHtml::encode($value->province);?></td>
			<td><?php echo CHtml::encode($value->city);?></td>
			<td><?php echo CHtml::encode($value->area);?></td>
			<td><?php echo CHtml::encode($value->address);?></td>
			<td><?php echo CHtml::encode($value->is_used);?></td>
		     <td align="center" class="action">
                        <?php echo CHtml::link('编辑', array('naddress/update','id'=>$value->id)); ?>
                        <?php echo CHtml::link('删除', 'javascript:deleteSelect('.$value->id.');'); ?>
                    </td>
		</tr>
		<?php }?>
	</tbody>
</table>
<!-- 数据表格 -->

<!-- 数据分页 -->
<div class="mylist_foot">
    <div class="fl p10 btn"><a href="javascript:deleteSelect(0);">批 量 删 除</a></div>
    <div class="fl p10 btn"><?php echo CHtml::link('添 加', array('naddress/create')); ?>
</div>
	<div class="pagecss fr">
	<?php $this->widget("CLinkPager", array(
        "pages" => $data->pagination,
        "header"=>"跳转到：",
        "prevPageLabel"=>"&lt; 上一页",
        "nextPageLabel"=>"&gt; 下一页",
        "firstPageLabel"=>"&lt;&lt; 首页",
        "lastPageLabel"=>"&gt;&gt; 尾页",
        "maxButtonCount"=>5,
        "footer"=>"当前页数：".($data->pagination->currentPage+1)." 总页数：".$data->pagination->pageCount." 总记录数：".$data->pagination->itemCount
    )) ?>
	</div>
</div>

<?php if(Yii::app()->user->hasFlash('success'))
        echo "<script> art.dialog({
        id: 'dialogTest',
        title: '提示信息',
        time: 5,
        icon: 'succeed',
        content: '<b>操作成功！</b><br /><br />该消息5秒后自动消失！',
        button: [
            {
                name: '确定',
                focus: true
            }]
    });</script>" 

?><!-- 数据分页 -->
<!-- 脚本 -->
<script type="text/javascript">
    function deleteSelect(id){
        ajaxSubmitdeleteSelect(id,'<?php echo Yii::app()->createUrl('naddress/delete',array('id'=>0)) ?>
');
    }
</script>
<!-- 脚本 -->
